package org.datasetcreator.reader;

import java.io.File;

import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

public final class HIbernateUtil {

	private HIbernateUtil() {
		// nothing to do!
	}

	public static Configuration getHibernateConfiguration(File baseDir,
			File confFile) {
		Configuration conf = new Configuration();
		conf.configure(confFile);
		conf.addDirectory(baseDir);
		conf.buildMappings();
		return conf;
	}

	public static void exportSchemaFromConf(Configuration conf) {
		SchemaExport schemaExp = new SchemaExport(conf);
		schemaExp.create(true, false);
	}

}
